package com.luo.backend.dto;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 管理员-商家列表响应DTO
 */
public class AdminMerchantListResponse {
    
    private List<MerchantItem> items;
    private Pagination pagination;
    private Statistics statistics;
    
    public static class MerchantItem {
        private Long id;
        private String name;
        private String description;
        private String logo;
        private String phone;
        private String address;
        private String businessHours;
        private BigDecimal minOrderAmount;
        private BigDecimal deliveryFee;
        private BigDecimal rating;
        private Integer ratingCount;
        private Integer status;
        private String statusText;
        private Long ownerUserId;
        private String ownerUsername;
        private LocalDateTime createdAt;
        private Long foodCount;
        private Long orderCount;
        private BigDecimal totalRevenue;
        
        // Getters and Setters
        public Long getId() { return id; }
        public void setId(Long id) { this.id = id; }
        
        public String getName() { return name; }
        public void setName(String name) { this.name = name; }
        
        public String getDescription() { return description; }
        public void setDescription(String description) { this.description = description; }
        
        public String getLogo() { return logo; }
        public void setLogo(String logo) { this.logo = logo; }
        
        public String getPhone() { return phone; }
        public void setPhone(String phone) { this.phone = phone; }
        
        public String getAddress() { return address; }
        public void setAddress(String address) { this.address = address; }
        
        public String getBusinessHours() { return businessHours; }
        public void setBusinessHours(String businessHours) { this.businessHours = businessHours; }
        
        public BigDecimal getMinOrderAmount() { return minOrderAmount; }
        public void setMinOrderAmount(BigDecimal minOrderAmount) { this.minOrderAmount = minOrderAmount; }
        
        public BigDecimal getDeliveryFee() { return deliveryFee; }
        public void setDeliveryFee(BigDecimal deliveryFee) { this.deliveryFee = deliveryFee; }
        
        public BigDecimal getRating() { return rating; }
        public void setRating(BigDecimal rating) { this.rating = rating; }
        
        public Integer getRatingCount() { return ratingCount; }
        public void setRatingCount(Integer ratingCount) { this.ratingCount = ratingCount; }
        
        public Integer getStatus() { return status; }
        public void setStatus(Integer status) { this.status = status; }
        
        public String getStatusText() { return statusText; }
        public void setStatusText(String statusText) { this.statusText = statusText; }
        
        public Long getOwnerUserId() { return ownerUserId; }
        public void setOwnerUserId(Long ownerUserId) { this.ownerUserId = ownerUserId; }
        
        public String getOwnerUsername() { return ownerUsername; }
        public void setOwnerUsername(String ownerUsername) { this.ownerUsername = ownerUsername; }
        
        public LocalDateTime getCreatedAt() { return createdAt; }
        public void setCreatedAt(LocalDateTime createdAt) { this.createdAt = createdAt; }
        
        public Long getFoodCount() { return foodCount; }
        public void setFoodCount(Long foodCount) { this.foodCount = foodCount; }
        
        public Long getOrderCount() { return orderCount; }
        public void setOrderCount(Long orderCount) { this.orderCount = orderCount; }
        
        public BigDecimal getTotalRevenue() { return totalRevenue; }
        public void setTotalRevenue(BigDecimal totalRevenue) { this.totalRevenue = totalRevenue; }
    }
    
    public static class Pagination {
        private Integer currentPage;
        private Integer pageSize;
        private Long totalItems;
        private Integer totalPages;
        
        public Pagination(Integer currentPage, Integer pageSize, Long totalItems) {
            this.currentPage = currentPage;
            this.pageSize = pageSize;
            this.totalItems = totalItems;
            this.totalPages = (int) Math.ceil((double) totalItems / pageSize);
        }
        
        // Getters and Setters
        public Integer getCurrentPage() { return currentPage; }
        public void setCurrentPage(Integer currentPage) { this.currentPage = currentPage; }
        
        public Integer getPageSize() { return pageSize; }
        public void setPageSize(Integer pageSize) { this.pageSize = pageSize; }
        
        public Long getTotalItems() { return totalItems; }
        public void setTotalItems(Long totalItems) { this.totalItems = totalItems; }
        
        public Integer getTotalPages() { return totalPages; }
        public void setTotalPages(Integer totalPages) { this.totalPages = totalPages; }
    }
    
    public static class Statistics {
        private Long totalMerchants;
        private Long activeCount;
        private Long closedCount;
        private Long totalFoods;
        private Long totalOrders;
        private BigDecimal totalRevenue;
        
        // Getters and Setters
        public Long getTotalMerchants() { return totalMerchants; }
        public void setTotalMerchants(Long totalMerchants) { this.totalMerchants = totalMerchants; }
        
        public Long getActiveCount() { return activeCount; }
        public void setActiveCount(Long activeCount) { this.activeCount = activeCount; }
        
        public Long getClosedCount() { return closedCount; }
        public void setClosedCount(Long closedCount) { this.closedCount = closedCount; }
        
        public Long getTotalFoods() { return totalFoods; }
        public void setTotalFoods(Long totalFoods) { this.totalFoods = totalFoods; }
        
        public Long getTotalOrders() { return totalOrders; }
        public void setTotalOrders(Long totalOrders) { this.totalOrders = totalOrders; }
        
        public BigDecimal getTotalRevenue() { return totalRevenue; }
        public void setTotalRevenue(BigDecimal totalRevenue) { this.totalRevenue = totalRevenue; }
    }
    
    // Getters and Setters
    public List<MerchantItem> getItems() { return items; }
    public void setItems(List<MerchantItem> items) { this.items = items; }
    
    public Pagination getPagination() { return pagination; }
    public void setPagination(Pagination pagination) { this.pagination = pagination; }
    
    public Statistics getStatistics() { return statistics; }
    public void setStatistics(Statistics statistics) { this.statistics = statistics; }
}








